package com.olt.dao.oltCenter;

import com.olt.domain.oltTest.ExamPaper;
import com.olt.domain.oltTest.OltProblemGroup;
import com.olt.server.dto.SelectDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.UUID;

public interface IExamPaper extends JpaRepository<ExamPaper,Long> {

    Page<ExamPaper> findAllByCreateUserOrderByCrateTimeDesc(Long user, Pageable page);

    @Query(value = "select new  com.olt.server.dto.SelectDto(p.paperId,p.paperName,'') from ExamPaper p where p.createUser=?1 ")
    List<SelectDto<Long>>getPaperForSelect(Long userId);
}
